#!/bin/sh

if [ "$(uci -q get omr-tracker.omrvpn)" = "" ]; then
	uci -q batch <<-EOF >/dev/null
		delete omr-tracker.glorytun
		set omr-tracker.omrvpn=interface
		set omr-tracker.omrvpn.type="none"
		set omr-tracker.omrvpn.timeout=6
		set omr-tracker.omrvpn.tries=2
		set omr-tracker.omrvpn.interval=4
		set omr-tracker.omrvpn.mail_alert=0
		set omr-tracker.omrvpn.enabled=1
		commit omr-tracker
	EOF
fi

if [ "$(uci -q get omr-tracker.omrvpn.enabled)" = "" ]; then
	uci -q batch <<-EOF >/dev/null
		set omr-tracker.omrvpn.enabled=1
		commit omr-tracker
	EOF
fi


rm -f /tmp/luci-indexcache

exit 0
